const Router = require('koa-router')

const {
  create,
  avatarInfo
} = require('../controllers/user.controller')

const {
  verifyUser,
  handlePassword
} = require('../middlewares/user.middleware')

const userRouter = new Router({prefix: '/user'})

// 用户注册
userRouter.post('/', verifyUser, handlePassword, create)
// 获取用户头像图片
userRouter.get('/:userId/avatar', avatarInfo)

module.exports = userRouter